package com.lovo.middleman.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lovo.middleman.bean.RoleBean;
import com.lovo.middleman.mapper.RoleMapper;
import com.lovo.middleman.service.IRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, RoleBean> implements IRoleService {

    @Autowired
    RoleMapper roleMapper;

    @Override
    public Page<RoleBean> queryPageBean(int curPage, int pageSize) {
        return roleMapper.selectPage(new Page<>(curPage, pageSize), null);
    }

    @Override
    public void addRoleBean(RoleBean roleBean) {
        roleMapper.insert(roleBean);
    }

    @Override
    public void deleteRoleBean(int roleId) {
        roleMapper.deleteById(roleId);
    }

    @Override
    public RoleBean queryRoleBean(int roleId) {
        return roleMapper.selectById(roleId);

    }

    @Override
    public void updateRoleBean(int roleId) {
        //先出现在修改

    }
}
